package XunChunCPU.Accelerator

import chisel3._

// 全加器
class Adder extends Module{
    val io = IO(new Bundle{
        val A = Input(Bool())
        val B = Input(Bool())
        val Cin = Input(Bool())
        val Cout = Output(Bool())
        val S = Output(Bool())
    })   
    io.S := io.A ^ io.B ^ io.Cin
    io.Cout := ((io.A ^ io.B) & io.Cin) | (io.A & io.B)
}